/*
 * Threadable.h
 *
 * Author: Samuel Queiroz
 */

#ifndef THREADABLE_H_
#define THREADABLE_H_

#include "Runnable.h"

#include <pthread.h>

class Threadable
	: public Runnable
{

protected:

	bool stop_;

public:

	virtual ~Threadable()
	{

	}

	void stop()
	{
		stop_ = true;
	}

	static void *run_(void *thread)
	{
		((Threadable *) thread)->run();

		return thread;
	}

};

#endif
